package com.cskaoyan.day6;

public class TwoDimensionalArray {
    public static void main(String[] args) {
        double[][] sale={{30,66,48},{10,33,20},{10,99,103},{9,18,27}};
        quarterSale(sale);
    }

    private static void quarterSale(double[][] sales) {
        double yearSum=0;
        for (int i = 0; i < sales.length; i++) {
            double sum=0;
            for (int j = 0; j < sales[i].length; j++) {
                sum+=sales[i][j];
            }
            System.out.println("第" + (i + 1) + "季度平均销售总额为" + (sum) / 3);
            yearSum+=sum;
        }
        System.out.println("年度销售总额为" + yearSum);
    }
}
